<!doctype html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>SuperSplat 官方 Viewer 跳转</title>
  <style>
    body { font-family: system-ui,-apple-system,Segoe UI,Roboto; margin: 24px; }
    .box { max-width: 840px; margin: 0 auto; }
    a.button { display: inline-block; padding: 10px 14px; background: #1f6feb; color: #fff; text-decoration: none; border-radius: 8px; }
    .hint { color: #555; margin-top: 10px; }
    code { background: #f4f6f8; padding: 2px 6px; border-radius: 4px; }
  </style>
  <!-- 说明：此页构造官方 Viewer 的URL并提供一键打开 -->
</head>
<body>
  <div class="box">
    <h1>使用 SuperSplat 官方渲染器查看李白诗境</h1>
    <p>现在已在本地集成官方 Viewer 静态站点，推荐直接使用本地版本：</p>
    <ul>
      <li>内容：<code>https://localhost:8091/environments/libai_3dgs.ply</code></li>
      <li>选项：隐藏 UI（<code>noui</code>）、禁用相机叠加（<code>camera.overlay=false</code>）</li>
    </ul>
    <p>
      <a id="open-local" class="button" target="_blank" rel="noopener noreferrer">打开本地 SuperSplat Viewer</a>
      &nbsp; &nbsp;
      <a id="open-remote" class="button" target="_blank" rel="noopener noreferrer" style="background:#555">备用：打开官方在线 Editor</a>
    </p>
    <p class="hint">
      若打不开或出现跨域问题，请确保已通过 <code>run.sh --https-frontend --frontend-port 8091</code> 启动，并使用本机浏览器访问。
    </p>
  </div>
  <script>
    (function(){
      const plyUrl = new URL('/environments/libai_3dgs.ply', window.location.origin).href;
      const localViewerUrl = new URL('/supersplat-viewer-local/index.html', window.location.origin).href;
      const localParams = new URLSearchParams({
        content: plyUrl,
        noui: 'true',
        ministats: 'true'
      });
      const remoteEditorUrl = 'https://superspl.at/editor';
      const remoteParams = new URLSearchParams({
        load: plyUrl,
        noui: 'true',
        'camera.overlay': 'false'
      });

      const openLocal = document.getElementById('open-local');
      const openRemote = document.getElementById('open-remote');
      openLocal.href = localViewerUrl + '?' + localParams.toString();
      openRemote.href = remoteEditorUrl + '?' + remoteParams.toString();
    })();
  </script>
</body>
</html>